The embodiments relate to error correction techniques, and more particularly, to methods and apparatuses for generating error correction codes corresponding to data with a block configuration.
In data storage systems and data transmission systems, error correction techniques are sometimes utilized to improve data reliability. For example, data to be written onto an optical disc need to be encoded to generate corresponding error correction codes. These error correction codes are then written onto the optical disc so that a data reproducing system, such as an optical disc drive, is able to check and correct errors within the retrieved error correction codes and accordingly reproduce the original data.
FIG. 1 shows a typical error correction code (ECC) block 100 utilized in a digital versatile disc (DVD) or a high definition DVD (HD-DVD). The ECC block 100 is composed of an original data block 110, a column-direction parity block 120, and a row-direction parity block 130. The column-direction parity block 120 and the row-direction parity block 130 are referred to as Parity Outer (PO) and Parity Inner (PI) of the ECC block 100 respectively. Generally speaking, the original data block 110 is made up of sixteen data sectors and includes 192 rows and 172 columns. The 192 rows and 172 columns form 33,024 intersections and therefore allow a total amount of 33,024 data symbols, each of which is one byte in size, to be included in the original data block 110. The column-direction parity block 120 has 172 columns, each of which includes 16 parity symbols. The row-direction parity block 130 has 208 rows, each of which includes 10 parity symbols. Each of the parity symbols of the column-direction parity block 120 and the row-direction parity block 130 is one byte in size. Consisting of the original data block 110, the column parity block 120, and the row parity block 130, the ECC block 100 as a whole has 208 rows and 182 columns and therefore allows a total amount of 37,856 bytes of data to be included therein.
In the related art, to generate the ECC block 100 the original data block 110 is first column-wise accessed to calculate parity symbols that form the column-direction parity block 120. Then, the original data block 110 and the column-direction parity block 120 are row-wise accessed to calculate parity symbols that form the row-direction parity block 130. During the ECC generation process, a storage medium must be utilized to provide buffer space. However, for some kinds of storage media, such as dynamic random access memory (DRAM), accessing data in one direction may be less efficient than in another direction. The above-mentioned ECC generation procedure is not efficient if the storage media that provides buffering space is inherently unsuitable for either row-wise access or column-wise access. For example, if a DRAM is column-wise accessed, page missing will be encountered frequently, causing an extra clock cycle to be consumed each time.
The above-mentioned ECC generation procedure also prohibits the potential simultaneous processing of multiple tasks due to the conflicting data accessing directions. Therefore the overall efficiency of ECC generation procedure is limited.